# class Father:
#     def my_fun(self):
#         print("Father")
#
#
# class Son1(Father):
#     def my_fun(self):
#         print("Son1")
#
#
# class Son2(Father):
#     def my_fun(self):
#         print("Son2")
#
#
# class Grandson(Son1, Son2):
#     def my_fun(self):
#         print("Grandson")
#
#
# d = Grandson()
# d.my_fun()


# 菱形继承
# class Father:
#     def __init__(self):
#         print("this is Father")
#
#     def my_fun(self):
#         print("Father")
#
#
# class Son1(Father):
#     def __init__(self):
#         Father.__init__(self)
#
#     def my_fun(self):
#         print("Son1")
#
#
# class Son2(Father):
#     def __init__(self):
#         Father.__init__(self)
#
#     def my_fun(self):
#         print("Son2")
#
#
# class Grandson(Son1, Son2):
#     def __init__(self):
#         Son1.__init__(self)
#         Son2.__init__(self)
#
#     def my_fun(self):
#         print("Grandson")
#
#
# d = Grandson()
# d.my_fun()

class Father:

    def __init__(self):
        print("this is Father")

    def my_fun(self):
        print("Father")


class Son1(Father):

    def __init__(self):
        print("Son1 init")
        super().__init__()

    def my_fun(self):
        print("Son1")


class Son2(Father):

    def __init__(self):
        print("son2 init")
        super().__init__()

    def my_fun(self):
        print("Son2")


class Grandson(Son1, Son2):

    def __init__(self):
        super().__init__()

    def my_fun(self):
        print("Grandson")


d = Grandson()
d.my_fun()
